package com.ztky.report;

import java.time.LocalDateTime;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Jason on 2017/3/1.
 */
@RestController
@SpringBootApplication
@MapperScan(basePackages = "com.ztky.report.mapper")
public class ReportApplication extends SpringBootServletInitializer {
	@RequestMapping("/")
	String index() {
		return "Hello,This is SpringBoot";
	}

	@RequestMapping("/now")
	String now() {
		return "现在时间是:" + LocalDateTime.now();
	}

	public static void main(String[] args) {
		SpringApplication.run(ReportApplication.class, args);
	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		return builder.sources(ReportApplication.class);
	}
}
